const calculate = async (num1, num2, operation) => {
    switch (operation) {
        case 'add':
            return num1 + num2;
        case 'subtract':
            return num1 - num2;
        case 'multiply':
            return num1 * num2;
        case 'divide':
            if(num2 === 0) return '错误的操作'
            return num1 / num2;
        default:
            return '无效的操作';
    }
}
const calculateResult = async (num1,num2,num3,operation1,operation2) => {
    const result = await calculate(num1, num2, operation1);
    const finalResult = await calculate(result, num3, operation2);
    console.log(finalResult);
}
calculateResult(3, 5, 8, 'multiply', 'add');